<?php 

namespace Home\Controller;
use Think\Controller;
use Common\Common\Tree;
/**
* 个人展示,功能区
*/
class PeopleController extends Controller
{


	public function index(){
	//个人展示中心
		$sql = "SELECT `city`,`province`,`score`,`index` from `user` where `id` = '{$_SESSION['id']}'";

		$modle = M('user');

		$result = $modle -> query($sql);

		$this->assign('result',$result);
			
		
		$this->display();
		
	}

	public function article(){
	//发布文章
		// $sql = "SELECT `city`,`province`,`score`,`index` from `user` where `id` = '{$_SESSION['id']}'";

		// $modle = M('user');

		// $result = $modle -> query($sql);

		// $this->assign('result',$result);
			
		
		$this->display();
		
	}

	public function question(){
	//提出问题
		if (IS_POST) {
			var_dump($_POST);
		}
		// $sql = "SELECT `city`,`province`,`score`,`index` from `user` where `id` = '{$_SESSION['id']}'";

		// $modle = M('user');

		// $result = $modle -> query($sql);

		// $this->assign('result',$result);

		$model = M('category');
    	$categorys = $model->select();
    	$obj = new Tree();
    	$categorys = $obj->reload($categorys);
    	// exit;
    	$this->assign('categorys',$categorys);
			
		$this->display();
		
	}
	public function mail(){
		// var_dump(CORE_PATH.'Think'.EXT);
		include ('./ThinkPHP/Library/Org/Mail.class.php');
        $info = SendMail('1207044909@qq.com','test123','test123','学并思测试邮件');
        var_dump($info);
	}


	public function ueditor(){
        $data = new \Org\Util\Ueditor();
        echo $data->output();
    }




}
?>